<?php

namespace slinks\extensions\action\interceptor;

use \slinks\extensions\action\core\IActionInvocation;

/**
 * Description of JsonEncodingInterceptor
 *
 * @author navid
 */
class JsonEncodingInterceptor implements IActionInterceptor{

    public function intercept(IActionInvocation $invocation) {
        $temp = json_encode($invocation->getReturnValue());
        $invocation->setReturnValue($temp);
        
        $invocation->invoke();
    }

}
